package com.manlost.biz.tag.impl.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.manlost.biz.common.ibatis.BaseSqlMapClientDaoSupport;
import com.manlost.biz.tag.impl.dao.interfaces.TagGroupDAO;
import com.manlost.biz.tag.model.dataobject.TagGroup;
import com.manlost.biz.tag.query.ListTagGroupQuery;

/**
 * 类TagGroupDAOImpl.java的实现描述：TODO 类实现描述
 * 
 * @author xiaochuan.luxc 2012-3-29 下午11:39:40
 */
@Repository
@SuppressWarnings("unchecked")
public class TagGroupDAOImpl extends BaseSqlMapClientDaoSupport implements TagGroupDAO {

    public TagGroup insert(TagGroup record) {
        getSqlMapClientTemplate().insert("tag_group.insert", record);
        return record;
    }

    public List<TagGroup> listTagGroup(ListTagGroupQuery query) {
        return (List<TagGroup>) getSqlMapClientTemplate().queryForList("tag_group.listTagGroupByQuery", query);
    }

    public TagGroup findById(Long tagGroupId) {
        return (TagGroup) getSqlMapClientTemplate().queryForObject("tag_group.findById", tagGroupId);
    }

    public void disableTagGroupById(Long tagGroupId) {
        getSqlMapClientTemplate().update("tag_group.disableTagGroupById", tagGroupId);
    }

}
